package consts

type HttpMethod int

const (
	HttpNone HttpMethod = iota
	HttpGet
	HttpPost
	HttpPut
	HttpDelete
)

func GetHttpMethod(method string) HttpMethod {
	switch method {
	case "GET":
		return HttpGet
	case "POST":
		return HttpPost
	case "PUT":
		return HttpPut
	case "DELETE":
		return HttpDelete
	}

	return HttpNone
}

func (h HttpMethod) String() string {
	switch h {
	case HttpGet:
		return "GET"
	case HttpPost:
		return "POST"
	case HttpPut:
		return "PUT"
	case HttpDelete:
		return "DELETE"
	}

	return "NONE"
}
